<#-- 导入模版定义文件-->
<#include "../template/template_editPage.ftl">
<@edit title="价格模板">
	<#if (templateCode)??>
		<#assign isEdit = true />
	<#else>
		<#assign isAdd = true />
	</#if>



<body class="input">

 <script type="text/javascript">
	$().ready( function() {
	
		var $validateErrorContainer = $("#validateErrorContainer");
		var $validateErrorLabelContainer = $("#validateErrorContainer ul");
		var $validateForm = $("#inputForm");
		var $tab = $("#tab");
	
		// Tab效果
		$tab.tabs(".tabContent", {
			tabs: "input"
		});
		
		// 表单验证
		$validateForm.validate({
			errorContainer: $validateErrorContainer,
			errorLabelContainer: $validateErrorLabelContainer,
			wrapper: "li",
			errorClass: "validateError",
			ignoreTitle: true,
			rules: {
					"gamePriceTemplate.templateName": {
						required: true
					}
                },
			messages: {
					"gamePriceTemplate.templateName": {
						required: "请输入模板名称！"
					}
                },
			submitHandler: function(form) {
				//$(form).find(":submit").attr("disabled", true);
				form.submit();
			}
		});
	<#if actionErrors?? && (actionErrors?size > 0)>
        $.dialog({type: "warn", content: "<#list errorMessages as list>${list}<br></#list>",
            modal: true, autoCloseTime: 3000});
		</#if>
	});
	</script>

	<div class="body">
		<div class="inputBar">
			<h1><span class="icon">&nbsp;</span><#if isAdd??>添加价格模板<#else>编辑价格模板</#if></h1>
		</div>
		<div style="display: none;" id="validateErrorContainer" class="validateErrorContainer">
				<div class="validateErrorTitle">以下信息填写有误,请重新填写</div>
				<ul></ul>
		</div>
		<form id="inputForm" class="validate" action="<#if isAdd??>${web_base}/game/game_price_template!save.htm<#else>${web_base}/game/game_price_template!edit.htm</#if>" method="post">
            <input type="hidden" name="tempCode" value="${tempCode!}">
            <input type="hidden" name="templateName" value="${templateName!}">
			<ul class="tab">
				<li>
					<input type="button" value="基本信息" hidefocus="true" />
				</li>
			</ul>
            <input type="hidden" name="gamePriceTemplate.id" class="formText" value="${(gamePriceTemplate.id)!}" />
			<table class="inputTable tabContent">
                <#if !isAdd??>
				<tr>
					<th>
                        模板编号:
					</th>
					<td>
                         ${(gamePriceTemplate.templateCode)!}
						<input type="hidden" name="gamePriceTemplate.templateCode" class="formText" value="${(gamePriceTemplate.templateCode)!}" />

					</td>
				</tr>
                </#if>

                <tr>
                    <th>
                        模板名称:
                    </th>
                    <td>
                        <#if isAdd??>
                            <input type="text" name="gamePriceTemplate.templateName" class="formText {required: true}" value="" />
                            <label class="requireField">*</label>
                        <#else>
                            <input type="text" name="gamePriceTemplate.templateName" class="formText {required: true}" value="${(gamePriceTemplate.templateName)!}" />
                            <label class="requireField">*</label>
                        </#if>
                    </td>
                </tr>
                <tr>
                    <th>
                        备注:
                    </th>
                    <td>
                        <#if isAdd??>
                            <textarea class="formText" style="width:210px;height: 80px " name="gamePriceTemplate.remark" value=""></textarea>
                        <#else>
                            <textarea class="formText" style="width:210px;height: 80px " name="gamePriceTemplate.remark" value="">${(gamePriceTemplate.remark)!}</textarea>
                        </#if>
                    </td>
                </tr>
			</table>
			<div class="buttonArea">
				<input type="submit" class="formButton" <#if isAdd??> value="添  加" <#else> value="更  新"</#if>hidefocus="true" />&nbsp;&nbsp;&nbsp;&nbsp;
				<input type="button" class="formButton" onclick="window.history.back(); return false;" value="返  回" hidefocus="true" />
			</div>
		</form>
	</div>
</body>
</@edit>
